﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;
using System.Web.Services;
using Newtonsoft.Json;

namespace PropertyAppraisal.SystemManage
{
    public partial class XiTongCai : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        /// <summary>
        /// 菜单列表
        /// </summary>
        /// <returns></returns>


        private static string Serialize(dynamic list)
        {
            return JsonConvert.SerializeObject(list);
        }
        [WebMethod]
        public static string AuthorityList(string name)
        {
            var list = new AuthorityBll().AuthorityList();
            if(string.IsNullOrWhiteSpace(name))
            {
                return Serialize(list);
            }
            else
            {
                return Serialize(list.Where(n => n.authority_Name.Contains(name)));
            }
         
        }
    }
}